package utils

import "golang.org/x/crypto/bcrypt"

func Encrypt(value string) (encryptValue string) {
	valueByte, _ := bcrypt.GenerateFromPassword([]byte(value), bcrypt.DefaultCost)
	return string(valueByte)
}

func Decrypt(encryptValue, value string) error {
	return bcrypt.CompareHashAndPassword([]byte(encryptValue), []byte(value))
}
